home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / sbprolog / amiga / v3_1 / sbp3_1e.lzh / BIRDS.PL < prev    next >
Text File  |  1991-10-31  |  960b  |  42 lines

  1. /* From the book PROLOG PROGRAMMING IN DEPTH
  2.    by Michael A. Covington, Donald Nute, and Andre Vellino.
  3.    Copyright 1988 Scott, Foresman & Co.
  4.    Non-commercial distribution of this file is permitted. */
  5. /* Modified for Quintus Prolog by Andreas Siebert */
  6.  
  7. /* BIRDS.PL */
  8. /* For use with DREASON.PL */
  9.  
  10. /*
  11.  * N.B.: This file will not reconsult properly in Arity Prolog
  12.  * and in some other Prologs because the interpreter will
  13.  * take the two defeasible rules to be facts for the
  14.  * predicate := instead of rules for the predicate flies.
  15.  * Since these rules are not contiguous in the file, the
  16.  * first rule will be retracted when the second rule is
  17.  * added to the database.
  18.  */
  19.  
  20. :- no_style_check(discontiguous).
  21. :- dynamic (neg)/1, bird/1, penguin/1.
  22. :- multifile (neg)/1.
  23.  
  24. flies(X) :=
  25.      bird(X).
  26.  
  27. neg flies(X) :-
  28.      penguin(X).
  29.  
  30. neg flies(X) :^
  31.      sick(X).
  32.  
  33. flies(buzz) :=
  34.      true.
  35.  
  36. bird(woody).
  37.  
  38. bird(X) :-
  39.      penguin(X).
  40.  
  41. penguin(chilly).
  42.